import Dayjs from 'dayjs';
export default {
    getDateTime(vm) {
        let movieDetail = vm.movieModel;
        if (getApp().globalData.subcontracting_movie?.$utils?.isCheckEmpty?.(movieDetail)) return '';
        let str = '';
        str = Dayjs(movieDetail.startTime).format('MM-DD HH:mm');
        str += '~';
        str += Dayjs(movieDetail.endTime).format('HH:mm');
        str += `(${movieDetail.language} ${movieDetail.version})`;
        return str;
    },
    getDeductionPrice(vm) {
        let data = getApp().globalData.subcontracting_movie.maxCoupon;
        if (data.discountCouponId) {
            if (data.saveAmount < vm.amount) {
                return parseFloat(vm.amount - data.saveAmount).toFixed(2);
            } else {
                return parseFloat(0).toFixed(2);
            }
        }
        return vm.amount;
    },
    setSeatsList(vm) {
        let list = vm.seatsList.map(e => {
            return {
                SeatCode: e.SeatCode,
                Name: e.Name,
				showPrice: e?.showPrice || 0, // 官方价格/座位市场价
				salePrice: e?.salePrice || 0, // 销售价格/座位销售价
                settlementPrice: e?.settlementPrice || 0, // 座位特惠购票结算价格
                settlementQuickPrice: e?.settlementQuickPrice || 0, // 座位快捷出票结算价格
            };
        });
        return list || [];
        // return {
        // 	seats: list,
        // 	changeSeat: vm.isSeatValue ? 1 : 0
        // }
    },
};
